package com.heu.blood.storge.controller;

import java.util.Arrays;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.heu.blood.storge.entity.DictTemplateEntryEntity;
import com.heu.blood.storge.service.DictTemplateEntryService;
import com.heu.blood.common.utils.PageUtils;
import com.heu.blood.common.utils.R;



/**
 * 
 *
 * @author lrz
 * @email 2963864804@qq.com
 * @date 2024-04-07 19:31:27
 */
@RestController
@RequestMapping("storge/dicttemplateentry")
public class DictTemplateEntryController {
    @Autowired
    private DictTemplateEntryService dictTemplateEntryService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = dictTemplateEntryService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Integer id){
		DictTemplateEntryEntity dictTemplateEntry = dictTemplateEntryService.getById(id);

        return R.ok().put("dictTemplateEntry", dictTemplateEntry);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody DictTemplateEntryEntity dictTemplateEntry){
		dictTemplateEntryService.save(dictTemplateEntry);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody DictTemplateEntryEntity dictTemplateEntry){
		dictTemplateEntryService.updateById(dictTemplateEntry);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids){
		dictTemplateEntryService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
